<?php
if(!defined('BLOG'))exit('不作死就不会死');
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/1/16
 * Time: 10:27
 */
class cookie{
    public static function set_cookie($key,$val,$time='',$path='',$domain='',$secure='',$mcrpty=true){
        $time = $time == ''?time()+3600:$time;
        $path = $path == ''?'/':$path;
        $domain = $domain ==''?'':$domain;
        $secure = $secure ==''?false:true;
        $val = $mcrpty?strmcrypt($val):$val;
       setcookie($key, $val, $time, $path , $domain, $secure);
    }
    public static function get_cookie($key){
        return strmcrypt_ex($_COOKIE[$key]);
    }
}